# -*- coding: utf-8 -*
# 游戏状态器
# 静态类，里面全是静态方法，相当于一个单例
#!/usr/bin/python3

from enum import Enum

class StateEnum(Enum):
    Alive = 1,
    Death = 2,

class InternalMunber:
    state = None
    def __init__(self,game_state):
        self.state = game_state


class GameState:
    __game_state = None
    #进入游戏
    @staticmethod
    def In():
        print("GameState In()")
        global __game_state
        __game_state = InternalMunber(StateEnum.Alive)
        print(__game_state.state)
        return

    #结束游戏
    @staticmethod
    def Out():
        print("GameState Out()")
        global __game_state
        __game_state.state = StateEnum.Death
        return

    @staticmethod
    def GetState():
        global __game_state
        return __game_state.state


    

GameState.In()
# GameState.Out()
# print(GameState.GetState())